﻿using ThingyCloudWPF.Creatures;

namespace ThingyCloudWPF.Network.Messages
{
	public class ThingyEatenMessage : Message
	{
		/// <summary>
		/// The avatar that ate the thingy
		/// </summary>
		private Avatar avatar;

		/// <summary>
		/// The thingy that is considered in this message
		/// </summary>
		private Thingy thingy;
		
		/// <summary>
		/// Creates a new message, and we need the avatar and thingy
		/// </summary>
		public ThingyEatenMessage(Avatar avatar, Thingy thingy)
		{
			this.avatar = avatar;
			this.thingy = thingy;
		}

		/// <summary>
		/// Builds the message string required by the end point
		/// </summary>
		/// <returns></returns>
		public override string ToMessageString()
		{
			return string.Format(
					"action:eat;aid:{0};acrid:{1};avar:{2};tid:{3};tcrid:{4};tvar:{5};",
					avatar.ID,
					avatar.Properties.ID,
					avatar.Variant.ID,
					thingy.ID,
					thingy.Properties.ID,
					thingy.Variant.ID
					);
		}
	}
}
